Learn R Programming

Momocs (version 0.1-03)

Outline: tps: Thin Plin Splines

Description

A method to compute Thin Plate Splines and display deformation grids.

Usage

tps(Nef, id.fr = 1, id.to = 5, nb.pts = 64, amp = 1,
	method = c("grid", "arr", "iso")[1],
	grid.size = 20, grid.col = "grey50",
	arr.nb = 100, arr.levels = 100,
	arr.len = 0.1, arr.ang = 30,
	arr.lwd = 1, arr.col = "grey50",
	iso.levels = 10, iso.nb = 5000,
    palette = col.summer, cont = TRUE,
	cont.col = col.gallus(2), cont.lwd = c(2, 2))

Arguments

Nef
the Nef class object to use.
id.fr
integer. The id of the 'starting' shape.
id.to
integer. The id of the 'ending' shape.
nb.pts
integer. The number of points to use to reconstruct shapes.
amp
numeric. An amplifying factor for differences between shapes.
method
character; "grid", "arr" and "iso" returns a simple deformation grid, a 'vector field' and isodeformation lines, respectively.
grid.size
numeric. The size of the deformation grid.
grid.col
color. The color of the grid.
arr.nb
integer. The number of arrows to display.
arr.levels
integer. The number of arrows levels for color purpose.
arr.len
numeric. The length of these arrows.
arr.ang
numeric. The angle of the arrows edges.
arr.lwd
numeric. The arrows line width.
arr.col
color. The color of these arrows (if palette is not supplied).
iso.levels
integer. The number of isolines levels.
iso.nb
integer. The number of lines to draw.
palette
a color palette such as those produced by colorRampPalette.
cont
logical. Whether to draw or not the shapes outlines.
cont.col
A vector containing the two as colors for the starting and ending shapes, respectively.
cont.lwd
A vector containing the two line widths as numeric for the outlines.

Details

Amplification is calculated after on Principal Component Analysis, i.e. the deformation are based on the mean shape and the position of the stwo shapes on the PC1 and PC2 axes.

Examples

Run this code
data(bot)
botF <- eFourier(bot)
tps(botF, 1, 2)
tps(botF, 1, 20, method="arr", arr.len=0.05, arr.nb=300, palette=col.sari)
tps(botF, 1, 20, method="iso", palette=col.gallus, amp=1.5)

Run the code above in your browser using DataLab